package dk.dashboardFP.elements.button {
	import dk.dashboardFP.interactionElementFramwork.buttonViews.AbstractButtonView;

	/**
	 * @author josef
	 */
	public class DFPButtonView extends AbstractButtonView {
		private var _sLabel : String;
		private var _nWidth : Number;
		private var _doSubView : DFPButtonSubView;

		public function DFPButtonView(sLabel:String, nWidth:Number=NaN) {
			
			_nWidth = nWidth;
			_sLabel = sLabel;
			super();
			
			setupElements();
		}
		
		private function setupElements() : void {
			
			//:::::::
			// subview 
			_doSubView=get_doSubView(_sLabel);
			addChild(_doSubView);
		}

		protected function get_doSubView(sLabel:String) : DFPButtonSubView {
			return new DFPButtonSubView(sLabel);
		}

		
		override public function enable() : void {
			super.enable();
			
			_doSubView.enable();
		}

		override public function disable() : void {
			super.disable();

			_doSubView.disable();
		}

		override public function select() : void {
			super.select();
			
			_doSubView.setOn();
		}

		override public function deSelect() : void {
			super.deSelect();
			
			_doSubView.setOff();
		}
	}
}
